#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;

public class BuffTagFixer : Editor
{
    [MenuItem("Tools/�޸� Buff ��ǩֵ")]
    public static void FixBuffTags()
    {
        var allBuffData = Resources.LoadAll<BuffData>("");
        int fixedCount = 0;

        foreach (var buff in allBuffData)
        {
            // ��ȡ���л�����
            SerializedObject so = new SerializedObject(buff);
            SerializedProperty tagProp = so.FindProperty("Tags");

            // ���ʵ�ʴ洢ֵ
            int storedValue = tagProp.intValue;

            //if (storedValue == 4) // ����ֵ
            //{
            //    Logger.Log($"�޸� {buff.name}: ֵ {storedValue} �� Control(2)");

            //    // ǿ������Ϊ Control ������ֵ
            //    tagProp.intValue = (int)BuffTag.Knockback;
            //    so.ApplyModifiedProperties();

            //    fixedCount++;
            //}
        }

        AssetDatabase.SaveAssets();
        Logger.Log($"�޸����! ���޸� {fixedCount} ����Դ");
    }
}
#endif